// pages/my/soucang/soucang.js
var app = getApp();
var $ = app.globalData;
Page({
	data: {

	},
	onLoad: function(options) {
		var that = this
		that.getsoucang()
	},

	clickGoods: function(e) {
		var thisid = e.currentTarget.dataset.id
		wx.navigateTo({
			url: "/pages/shopping/business/business?id=" + thisid
		})
	},
	pingtaigoods: function(e) {
		var that = this
		var thisid = e.currentTarget.dataset.id
		wx.navigateTo({
			url: "/pages/shopping/details/details?id=" + thisid + "&goodslib=0&daizhuce=" + that.data.daizhuce
		})
	},

	onShow: function() {
		var that = this
		that.getsoucang()
	},

	getsoucang: function() {
		var that = this
		// 获取用户信息
		wx.getStorage({
			key: 'userinfo',
			success: function(data) {
				wx.request({
					url: $.AdminUrl + "/YApi/getMyCollect",
					data: {
						customerid: data.data.id
					},
					success: (res) => {
						that.setData({
							goodslist: res.data.obj
						})
					}
				})
			}
		})
	}

})
